<?php
/**
 * File to del a group of BugFree system.
 *
 * BugFree is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * BugFree is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with BugFree; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @link        http://bugfree.1zsoft.com
 * @package     BugFree
 * @version     $Id: DelBugGroup.php,v 1.1 2005/09/01 07:25:08 wwccss Exp $
 */

/* Init BugFree system. */
require_once("../Include/SetupBug.inc.php");

/* Judge admin user. */
bugJudgeAdminUser();

if(!empty($_GET["BugGroupID"]))
{
    if($_GET["Delete"] == "Yes")
    {
        $SQL = " DELETE FROM BugGroup WHERE GroupID = '$_GET[BugGroupID]' LIMIT 1";
        if($MyDB->query($SQL))
        {
            $MyJS->alert($TplConfig["DelBugGroup"]["Success"]);
            $MyJS->goto("ListBugGroup.php");
            exit;
        }
        else
        {
            die($MyDB->errorMsg());
        }
    }
    else
    {
        $MyJS->Confirm($TplConfig["DelBugGroup"]["ConfirmInfo"],"DelBugGroup.php?Delete=Yes&BugGroupID=$_GET[BugGroupID]","Back");
    }
}
else
{
    $MyJS->alert($TplConfig["DelBugGroup"]["ErrorGroupID"]);
}
?>